﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WebBLL;
using WebMODEL;

namespace WebAPI.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class MemberController : ControllerBase
    {
        public MemberController(MemberBLL bLL)
        {
            BLL = bLL;
        }

        public MemberBLL BLL { get; }

        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        [HttpPost("AddMem")]
        public int AddMem(Member m)
        {
            return BLL.AddMem(m);
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Pwd"></param>
        /// <returns></returns>
        [HttpPost("Login")]
        public Member Login(string Name, string Pwd)
        {
            return BLL.Login(Name, Pwd);
        }
    }
}
